#include<stdio.h>

float cpuPI(int num){
      float sum=0.0f;
      float temp;
      int i;
      for(i=0;i<num;i++){
          temp=(i+0.5f)/num;
          sum+=4/(1+temp*temp);
      }
      return sum/num;
   }
void main()
{
printf("pi is %f\n",cpuPI(10000000));
}
